import '@/styles/main.scss'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import './permission'
import { createPersistedState } from 'pinia-plugin-persistedstate'
import installFilter from '@/filters/index'
import directive from './directive'
import AppConfig from './config.global'
import '@/utils/autoUpdate'

const app = createApp(App)
const pinia = createPinia()
pinia.use(
  createPersistedState({
    key: (id) => {
      return `_${AppConfig.projectKey}_${id}`
    }
  })
)
app.use(pinia)
app.use(router)
installFilter(app)
app.use(directive)

app.mount('#app')
